package com.alks.function.controller.finance.salary;


import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.administration.JobTypeChangeRequest;
import com.alks.function.data.request.finance.salary.JobTypeRequest;
import com.alks.function.data.request.finance.salary.getEmployeeRequest;
import com.alks.function.data.request.finance.salary.getPcEmployeeWorkTypeRequest;
import com.alks.function.service.finance.salary.SalaryFileCreationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;


@ApiRestController("/salaryFile")
@Api(tags = {"工厂-人事薪资作业-薪资档案建档-3"})
@Slf4j
public class SalaryFileCreationController {

    @Resource
    private SalaryFileCreationService salaryFileCreationService;

    @WebLogger
    @ApiOperation(value = "工种工资建档-查询",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @GetMapping("/ListOfWagesForJobTypes")
    public ResponseInfo ListOfWagesForJobTypes(@RequestParam(required = false) String workType){
        return salaryFileCreationService.ListOfWagesForJobTypes(workType);
    }

    @WebLogger
    @ApiOperation(value = "工种工资建档-插入",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PutMapping("/JobTypeSalaryUpdate")
    public ResponseInfo JobTypeSalaryUpdate(@RequestBody Map<String,String> map){
        return salaryFileCreationService.JobTypeSalaryUpdate(map);
    }

    @WebLogger
    @ApiOperation(value = "工种变更查询",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/JobTypeChangeInquiry")
    public ResponseInfo JobTypeChangeInquiry(@RequestBody JobTypeRequest request){
        return salaryFileCreationService.JobTypeChangeInquiry(request);
    }

    @WebLogger
    @ApiOperation(value = "员工资料明细",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/EmployeeList")
    public ResponseInfo EmployeeList(@RequestBody getEmployeeRequest request){
        return salaryFileCreationService.EmployeeList(request);
    }

    @WebLogger
    @ApiOperation(value = "变更查询",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/ChangeQuery")
    public ResponseInfo ChangeQuery(@RequestBody getEmployeeRequest request){
        return salaryFileCreationService.ChangeQuery(request);
    }

    @WebLogger
    @ApiOperation(value = "变更确认",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/ChangeConfirmation")
    public ResponseInfo ChangeConfirmation(@RequestBody JobTypeChangeRequest request){
        return salaryFileCreationService.ChangeConfirmation(request);
    }

    @WebLogger
    @ApiOperation(value = "工种建档-查询",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/JobTypeFilingQuery")
    public ResponseInfo JobTypeFilingQuery(@RequestBody getPcEmployeeWorkTypeRequest request){
        return salaryFileCreationService.JobTypeFilingQuery(request);
    }

    @WebLogger
    @ApiOperation(value = "工种建档-新增",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/JobTypeFilingAdd")
    public ResponseInfo JobTypeFilingAdd(@RequestBody getPcEmployeeWorkTypeRequest request){
        return salaryFileCreationService.JobTypeFilingAdd(request);
    }

    @WebLogger
    @ApiOperation(value = "工种建档-删除",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/JobTypeFilingDel")
    public ResponseInfo JobTypeFilingDel(@RequestParam String workTypeSeq){
        return salaryFileCreationService.JobTypeFilingDel(workTypeSeq);
    }

    @WebLogger
    @ApiOperation(value = "工种建档-修改",tags = "工厂-人事薪资作业-薪资档案建档-3")
    @PostMapping("/JobTypeFilingUpdate")
    public ResponseInfo JobTypeFilingUpdate(@RequestBody getPcEmployeeWorkTypeRequest request){
        return salaryFileCreationService.JobTypeFilingUpdate(request);
    }
}
